﻿<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="NguoiDung.ascx.cs" Inherits="VLXD.AdminControls.users" %>
<%@ Register assembly="AjaxControlToolkit" namespace="AjaxControlToolkit" tagprefix="asp" %>
<asp:MultiView ID="MultiView1" runat="server">
    <asp:View ID="View1" runat="server">
        &nbsp;&nbsp;
        <table width="550">
            <tr>
                <td>
                    <asp:LinkButton ID="LinkButton1" runat="server" OnClick="LinkButton1_Click">Thêm Mới</asp:LinkButton>
                    <asp:Image ID="Image1" runat="server" ImageUrl="~/uploads/admin/add-user-icon.png" />
                </td>
                <td>
                </td>
            </tr>
        </table>
        <br />
        <asp:Repeater ID="Repeater1" runat="server" OnItemCommand="Repeater1_ItemCommand">
            <HeaderTemplate>
                <table width="750" cellpadding="0" cellspacing="0" border="0">
                    <tr style="background-color: #006699; font-weight: bold; height: 30px; color: #ffffff">
                        <td width="180">
                            Tên đăng nhập
                        </td>
                        <td width="180">
                            Email
                        </td>
                        <td width="180">
                            Họ tên
                        </td>
                        <td>
                            Trạng thái
                        </td>
                        <td align="left">
                            Thao tác
                        </td>
                    </tr>
            </HeaderTemplate>
            <ItemTemplate>
                <tr style="height: 25px;" onmouseover="style.backgroundColor='#eef7ff';style.color='red'"
                    onmouseout="style.backgroundColor='#ffffff';style.color='black'">
                    <td>
                        <%#Eval("TenDangNhap")%>
                    </td>
                    <td>
                        <%#Eval("Email")%>
                    </td>
                    <td>
                        <%#Eval("TenDayDu")%>
                    </td>
                    <td>
                        <asp:LinkButton ID="lnkStatus" runat="server" CommandArgument='<%#Eval("ID") %>'
                            CommandName="status"><%#  (Boolean.Parse(Eval("HoatDong").ToString())) ? "Kích Hoạt" : "Không kích hoạt"%></asp:LinkButton>
                    </td>
                    <td align="left">
                        <asp:LinkButton ID="LinkButton2" runat="server" CommandArgument='<%# Eval("ID") %>'
                            CommandName="edit">Sửa</asp:LinkButton>&nbsp; ||
                        <asp:LinkButton OnLoad="Delete_Load" ID="LinkButton3" runat="server" CommandArgument='<%# Eval("ID") %>'
                            CommandName="del">Xóa</asp:LinkButton>
                    </td>
                </tr>
            </ItemTemplate>
            <FooterTemplate>
                </table>
            </FooterTemplate>
        </asp:Repeater>
    </asp:View>
    <asp:View ID="View2" runat="server">
        <table border="0" cellpadding="2" cellspacing="2" width="600">
            <tr>
                <td colspan="3">
                    <h2>
                        <strong>Thông tin người dùng</strong></h2>
                </td>
            </tr>
            <tr>
                <td style="width: 125px">
                </td>
                <td style="width: 5px">
                </td>
                <td>
                    &nbsp;<asp:HiddenField ID="HiddenField1" runat="server" />
                    <asp:HiddenField ID="HiddenField_Pass" runat="server" />
                </td>
            </tr>
            <tr>
                <td style="width: 125px">
                    Tên đăng nhập</td>
                <td style="width: 5px">
                </td>
                <td>
                    <asp:TextBox ID="txtTenDangNhap" runat="server" WIDth="180px" ReadOnly="True" 
                        CssClass="form_input"></asp:TextBox>
                    <asp:RequiredFieldValIDator ID="RequiredFieldValIDator1" runat="server" 
                        ControlToValIDate="txtTenDangNhap" ErrorMessage="(*)"></asp:RequiredFieldValIDator>
                </td>
            </tr>
            <tr>
                <td style="width: 125px">
                    Email</td>
                <td style="width: 5px">
                </td>
                <td>
                    <asp:TextBox ID="txtEmail" runat="server" WIDth="181px" CssClass="form_input"></asp:TextBox>
                    <asp:RequiredFieldValIDator ID="RequiredFieldValIDator2" runat="server" 
                        ControlToValIDate="txtEmail" Display="Dynamic" ErrorMessage="(*)"></asp:RequiredFieldValIDator>
                    <asp:RegularExpressionValidator ID="RegularExpressionValidator1" runat="server" 
                        ControlToValIDate="txtEmail" Display="Dynamic" 
                        ErrorMessage="Không đúng định dạng" 
                        ValIDationExpression="\w+([-+.']\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*"></asp:RegularExpressionValidator>
                </td>
            </tr>
            <tr>
                <td style="width: 125px">
                    Mật khẩu</td>
                <td style="width: 5px">
                </td>
                <td>
                    <asp:TextBox ID="txtMatKhau" runat="server" WIDth="180px" TextMode="Password" 
                        CssClass="form_input"></asp:TextBox>(để
                    trống nếu không muốn thay đổi)
                </td>
            </tr>
            <tr>
                <td style="width: 125px">
                    Họ tên</td>
                <td style="width: 5px">
                </td>
                <td>
                    <asp:TextBox ID="txtTenDayDu" runat="server" WIDth="180px" 
                        CssClass="form_input"></asp:TextBox>
                    <asp:RequiredFieldValIDator ID="RequiredFieldValIDator3" runat="server" 
                        ControlToValIDate="txtTenDayDu" ErrorMessage="(*)"></asp:RequiredFieldValIDator>
                </td>
            </tr>
            <tr>
                <td style="width: 125px; height: 28px;">
                    Địa chỉ</td>
                <td style="width: 5px; height: 28px;">
                </td>
                <td style="height: 28px">
                    <asp:TextBox ID="txtDiaChi" runat="server" WIDth="180px" CssClass="form_input"></asp:TextBox>
                    <asp:RequiredFieldValIDator ID="RequiredFieldValIDator4" runat="server" 
                        ControlToValIDate="txtDiaChi" ErrorMessage="(*)"></asp:RequiredFieldValIDator>
                </td>
            </tr>
            <tr>
                <td style="width: 125px">
                    Số điện thoại</td>
                <td style="width: 5px">
                </td>
                <td>
                    <asp:TextBox ID="txtSoDienThoai" runat="server" WIDth="180px" 
                        CssClass="form_input"></asp:TextBox>
                    <asp:RequiredFieldValIDator ID="RequiredFieldValIDator6" runat="server" 
                        ControlToValIDate="txtSoDienThoai" ErrorMessage="(*)" Display="Dynamic"></asp:RequiredFieldValIDator>
                    <asp:RegularExpressionValidator ID="RegularExpressionValidator3" runat="server" 
                        ControlToValIDate="txtSoDienThoai" Display="Dynamic" ErrorMessage="Sai định dạng" 
                        ValIDationExpression="0\d{9,10}"></asp:RegularExpressionValidator>
                </td>
            </tr>
            <tr>
                <td style="width: 125px">
                    Trạng thái</td>
                <td style="width: 5px">
                </td>
                <td>
                    <asp:CheckBox ID="ckHoatDong" runat="server" />
                </td>
            </tr>
            <tr>
                <td style="width: 125px">
                </td>
                <td style="width: 5px">
                </td>
                <td>
                </td>
            </tr>
            <tr>
                <td style="width: 125px">
                </td>
                <td style="width: 5px">
                </td>
                <td>
                    <asp:Button ID="btn_save" runat="server" OnClick="Button1_Click" Text="Lưu Lại" CssClass="form_submit" />
                    &nbsp;
                </td>
            </tr>
            <tr>
                <td style="width: 125px">
                </td>
                <td style="width: 5px">
                </td>
                <td>
                </td>
            </tr>
            <tr>
                <td style="width: 125px; height: 29px;">
                </td>
                <td style="width: 5px; height: 29px;">
                </td>
                <td style="height: 29px">
                </td>
            </tr>
            <tr>
                <td style="width: 125px">
                </td>
                <td style="width: 5px">
                </td>
                <td>
                    <asp:ScriptManager ID="ScriptManager1" runat="server" 
                        EnableScriptGlobalization="True">
                    </asp:ScriptManager>
                </td>
            </tr>
        </table>
    </asp:View>
    <asp:View ID="View3" runat="server">
        <table border="0" cellpadding="2" cellspacing="2" width="600">
            <tr>
                <td colspan="3">
                    <strong>Thêm tài Khoản</strong>
                </td>
            </tr>
            <tr>
                <td style="width: 125px; height: 19px;">
                </td>
                <td style="width: 5px; height: 19px;">
                </td>
                <td style="height: 19px; color: #FF0000; font-weight: 700;">
                    <asp:Literal ID="ltmsg" runat="server"></asp:Literal>
                </td>
            </tr>
            <tr>
                <td style="width: 125px">
                    Tên đăng nhập</td>
                <td style="width: 5px">
                </td>
                <td>
                    <asp:TextBox ID="ntxtTenDangNhap" runat="server" WIDth="180px" CssClass="form_input"></asp:TextBox>
                    <asp:RequiredFieldValIDator ID="RequiredFieldValIDator7" runat="server" 
                        ControlToValIDate="ntxtTenDangNhap" ErrorMessage="(*)"></asp:RequiredFieldValIDator>
                </td>
            </tr>
            <tr>
                <td style="width: 125px">
                    Email</td>
                <td style="width: 5px">
                </td>
                <td>
                    <asp:TextBox ID="ntxtEmail" runat="server" WIDth="180px" CssClass="form_input"></asp:TextBox>
                    <asp:RequiredFieldValIDator ID="RequiredFieldValIDator8" runat="server" 
                        ControlToValIDate="ntxtEmail" Display="Dynamic" ErrorMessage="(*)"></asp:RequiredFieldValIDator>
                    <asp:RegularExpressionValidator ID="RegularExpressionValidator2" runat="server" 
                        ControlToValIDate="ntxtEmail" Display="Dynamic" 
                        ErrorMessage="Không đúng định dạng" 
                        ValIDationExpression="\w+([-+.']\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*"></asp:RegularExpressionValidator>
                </td>
            </tr>
            <tr>
                <td style="width: 125px; height: 16px;">
                    Mật khẩu</td>
                <td style="width: 5px; height: 16px;">
                </td>
                <td style="height: 16px">
                    <asp:TextBox ID="ntxtMatKhau1" runat="server" TextMode="Password" WIDth="180px" CssClass="form_input"></asp:TextBox>
                    <asp:RequiredFieldValIDator ID="RequiredFieldValIDator9" runat="server" 
                        ControlToValIDate="ntxtMatKhau1" ErrorMessage="(*)"></asp:RequiredFieldValIDator>
                </td>
            </tr>
            <tr>
                <td style="width: 125px">
                    Nhập lại mật khẩu</td>
                <td style="width: 5px">
                </td>
                <td>
                    <asp:TextBox ID="ntxtMatKhau2" runat="server" TextMode="Password" WIDth="180px" CssClass="form_input"></asp:TextBox>
                    <asp:RequiredFieldValIDator ID="RequiredFieldValIDator10" runat="server" 
                        ControlToValIDate="ntxtMatKhau2" ErrorMessage="(*)"></asp:RequiredFieldValIDator>
                    <asp:CompareValIDator ID="CompareValIDator1" runat="server" 
                        ControlToCompare="ntxtMatKhau1" ControlToValIDate="ntxtMatKhau2" 
                        ErrorMessage="Mật khẩu không trùng"></asp:CompareValIDator>
                </td>
            </tr>
            <tr>
                <td style="width: 125px">
                    Họ tên</td>
                <td style="width: 5px">
                </td>
                <td>
                    <asp:TextBox ID="ntxtTenDayDu" runat="server" WIDth="180px" CssClass="form_input"></asp:TextBox>
                    <asp:RequiredFieldValIDator ID="RequiredFieldValIDator11" runat="server" 
                        ControlToValIDate="ntxtTenDayDu" ErrorMessage="(*)"></asp:RequiredFieldValIDator>
                </td>
            </tr>
            <tr>
                <td style="width: 125px">
                    Địa chỉ
                </td>
                <td style="width: 5px">
                </td>
                <td>
                    <asp:TextBox ID="ntxtDiaChi" runat="server" WIDth="180px" CssClass="form_input"></asp:TextBox>
                    <asp:RequiredFieldValIDator ID="RequiredFieldValIDator12" runat="server" 
                        ControlToValIDate="ntxtDiaChi" ErrorMessage="(*)"></asp:RequiredFieldValIDator>
                </td>
            </tr>
            <tr>
                <td style="width: 125px">
                    Số điện thoại</td>
                <td style="width: 5px">
                </td>
                <td>
                    <asp:TextBox ID="ntxtSoDienThoai" runat="server" WIDth="180px" CssClass="form_input"></asp:TextBox>
                    <asp:RequiredFieldValIDator ID="RequiredFieldValIDator14" runat="server" 
                        ControlToValIDate="ntxtSoDienThoai" ErrorMessage="(*)" Display="Dynamic"></asp:RequiredFieldValIDator>
                    <asp:RegularExpressionValidator ID="RegularExpressionValidator4" runat="server" 
                        ControlToValIDate="ntxtSoDienThoai" ErrorMessage="Sai định dạng" 
                        ValIDationExpression="0\d{9,10}"></asp:RegularExpressionValidator>
                </td>
            </tr>
            <tr>
                <td style="width: 125px">
                    Kích hoạt</td>
                <td style="width: 5px">
                </td>
                <td>
                    <asp:CheckBox ID="nHoatDong" runat="server" Checked="True" />
                </td>
            </tr>
            <tr>
                <td style="width: 125px">
                </td>
                <td style="width: 5px">
                </td>
                <td>
                </td>
            </tr>
            <tr>
                <td style="width: 125px">
                </td>
                <td style="width: 5px">
                </td>
                <td>
                    <asp:Button ID="Button3" runat="server" OnClick="Button3_Click" Text="Thêm Mới" CssClass="form_submit" />
                    &nbsp;
                </td>
            </tr>
            <tr>
                <td style="width: 125px">
                </td>
                <td style="width: 5px">
                </td>
                <td>
                </td>
            </tr>
            <tr>
                <td style="width: 125px; height: 29px;">
                </td>
                <td style="width: 5px; height: 29px;">
                </td>
                <td style="height: 29px">
                </td>
            </tr>
            <tr>
                <td style="width: 125px">
                </td>
                <td style="width: 5px">
                </td>
                <td>
                </td>
            </tr>
        </table>
    </asp:View>
</asp:MultiView>
